﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

[Serializable, StructLayout(LayoutKind.Sequential)]
public struct GameTagMask
{
    public List<string> tags;
    public void Add(string tag)
    {
        if (this.tags == null)
        {
            this.tags = new List<string>();
        }
        if (!this.tags.Contains(tag))
        {
            this.tags.Add(tag);
        }
    }

    public void Remove(string tag)
    {
        if (this.tags != null)
        {
            this.tags.Remove(tag);
        }
    }

    public bool IsMasked(string tag)
    {
        return ((this.Count == 0) || this.Contains(tag));
    }

    private bool Contains(string tag)
    {
        return ((this.tags != null) && this.tags.Contains(tag));
    }

    private int Count
    {
        get
        {
            return ((this.tags == null) ? 0 : this.tags.Count);
        }
    }
}

